<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>博客</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/my.css">
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>
</head>
<body>

<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" th:href="@{/}">博客系统</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="active"><a th:href="@{/search/all}">博客广场</a></li>
            </ul>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="active"><a th:href="@{/blog/own}">我的博客</a></li>
            </ul>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="active"><a th:href="@{/history/list}">历史记录</a></li>
            </ul>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="active"><a th:href="@{/user/myStar}">我的关注</a></li>
            </ul>
        </div>
        <form class="navbar-form navbar-left" action="/search/keyword" method="post">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="搜文章"
                       name="keyword">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
        <form class="navbar-form navbar-left" action="/search/author" method="post">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="搜作者"
                       name="username">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
        <label class="navbar-right row">
            <h4><em th:text="${session.username}"></em>,你好 <a
                    th:href="@{/blog/loginOut}">
                退出登录</a>
            </h4>
        </label>
    </div>
</nav>

<div>
    <div class="index-blog">
        <div th:each="show : ${indexBlogs}">
            <div class="form-group">
                <p>
                    <a th:href="'/blog/list/'+${show.id}"
                       th:text="${show.title}"
                       style="text-decoration: none"></a>
                </p>
                <p class="text-lowercase">
                    <em class="form-control blog-size"
                        th:text="${show.description}"></em>
                </p>
                <div>
                    <div class="thumb-size">
                        <span class="glyphicon glyphicon-thumbs-up"></span>
                        <span th:text="${show.thumbUpNum}"></span>
                        <span class="glyphicon glyphicon-star"
                              style="margin-left: 5px"></span>
                        <span th:text="${show.starNum}"></span>
                        <span class="glyphicon glyphicon-eye-open"
                              style="margin-left: 5px"></span>
                        <span th:text="${show.visitNum}"></span>
                        <span class="glyphicon glyphicon-comment"
                              style="margin-left: 5px"></span>
                        <span th:text="${show.commentNum}"></span>
                    </div>
                    <div class="author-size">
                        <span th:text="${show.author}"></span>
                        <span style="margin-left: 5px"
                              th:text="${show.createTime}"></span>
                    </div>
                </div></br>

            </div>
        </div>
    </div>
    <div class="index-recommend">
        <label>最新文章</label>
        <div th:each="newEm : ${newBlogs}">
            <a th:href="@{'/blog/list/'+${newEm.id}}"
               style="text-decoration: none">
                <p th:text="${newEm.title}"></p>
            </a>
        </div>
        <label style="margin-top: 20px">最热文章</label>
        <div th:each="weightEm : ${weight}">
            <a th:href="@{'/blog/list/'+${weightEm.id}}"
               style="text-decoration: none">
                <p th:text="${weightEm.title}"></p>
            </a>
        </div>

        <label style="margin-top: 20px">最热话题</label>
        <div th:each="categoryName : ${categoryNames}">
            <a th:href="@{'/search/keyword/'+${categoryName}}"
               style="text-decoration: none">
                <p th:text="${categoryName}"></p>
            </a>
        </div>
    </div>
</div>

</body>
</html>